@extends('admin.layout.index')

@section('content')
@if (count($errors) > 0)
     <!-- 错误提醒 -->
    <div class="mws-form-message error">
        <ul>
            @foreach ($errors->all() as $error)
                <li>{{ $error }}</li>
            @endforeach
        </ul>
    </div>
@endif
<div class="mws-panel grid_8">
                	<div class="mws-panel-header">
                    	<span>文章添加</span>
                    </div>
                    <div class="mws-panel-body no-padding">
                    	<form class="mws-form" action="/admin/artical/insert" method="post">
                    	{{ csrf_field() }}
                    		<div class="mws-form-inline"> 
                    			<div class="mws-form-row">
                    				<label class="mws-form-label">文章标题</label>
                    				<div class="mws-form-item">
                    					<input class="large" type="text" name="name" value="">
                    				</div>
                    			</div>
                    			<div class="mws-form-row">
                    				<label class="mws-form-label">文章内容</label>
                    				<div class="mws-form-item">
                    					<textarea rows="" cols="" class="large" name="content"></textarea>
                    				</div>
                    			</div>
                                   <div class="mws-form-row">
                                        <label class="mws-form-label">分类名称</label>
                                        <div class="mws-form-item">
                                        
                                             <select class="large" name="id">
                                                <!-- <option value="0">请选择</option> -->
                                                <!-- 遍历传过来的分类名称 -->
                                                @foreach($data as $k => $v )
                                                  <option value="{{$v['id']}}">{{$v['catname']}}</option>
                                                @endforeach
                                             </select>
                                        </div>
                                   </div>
                    		    </div>
                    		<div class="mws-button-row">
                    			<input value="提交" class="btn btn-danger" type="submit">
                    			<input value="重置" class="btn btn-danger" type="reset">
                    		</div>
                    	</form>
                    </div> 
                    </div>   	


@endsection